// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import Layout from '@/layout'
import $i18n from '@/language/index'
import {
  roterPre
} from '@/settings'
const productRouter = {
  path: `${roterPre}/product`,
  name: 'product',
  component: Layout,
  meta: {
    icon: 'dashboard',
    title: $i18n.t('commoditymanagement')
  },
  alwaysShow: true,
  redirect: 'noRedirect',
  children: [{
      path: 'classify',
      name: 'ProductClassify',
      meta: {
        title: $i18n.t('commodityclassification'),
        noCache: true
      },
      component: () => import('@/views/product/productClassify')
    },
    {
      path: 'attr',
      name: `ProductAttr`,
      meta: {
        title: $i18n.t('commodityspecifications'),
        noCache: true
      },
      component: () => import('@/views/product/productAttr')
    },
    {
      path: 'label',
      name: `ProductLabel`,
      meta: {
        title: $i18n.t('commoditylabel'),
        noCache: true
      },
      component: () => import('@/views/product/productLabel')
    },
    {
      path: 'list',
      name: `ProductList`,
      meta: {
        title: $i18n.t('productlist'),
        noCache: true
      },
      component: () => import('@/views/product/productList')
    },
    {
      path: 'copyProduct',
      name: `copyProduct`,
      meta: {
        title: $i18n.t('platformcommoditydistribution'),
        noCache: true
      },
      component: () => import('@/views/product/copyProduct')
    },
    {
      path: 'listPla',
      name: `listPla`,
      meta: {
        title: $i18n.t('platformwholesalecommodities'),
        noCache: true
      },
      component: () => import('@/views/product/listPla')
    },
    {
      path: 'list/addProduct/:id?/:edit?',
      component: () => import('@/views/product/addProduct/index'),
      name: 'AddProduct',
      meta: {
        title: $i18n.t('productaddition'),
        noCache: true,
        activeMenu: `${roterPre}/product/list`
      },
      hidden: true
    },
    {
      path: 'reviews',
      name: 'ProductReviews',
      meta: {
        title: $i18n.t('productreview')
      },
      component: () => import('@/views/product/Reviews/index')
    }
  ]
}

export default productRouter
